#include "edge.h"

#include "iedgedata.h"

using namespace core;

Edge::~Edge()
{
    if (m_data != 0)
    {
        m_data->registerEdge(0);
    }
}

const IEdgeData* Edge::getData() const
{
    return m_data;
}

Node* Edge::getSource() const
{
    return m_source;
}

Node* Edge::getDestination() const
{
    return m_destination;
}

Edge::Edge(Node* source, Node* destination, IEdgeData *data) :
    m_data(data),
    m_source(source),
    m_destination(destination)
{

}
